from config import db
from jieba.analyse import ChineseAnalyzer


class WebPage(db.Model):
    __tablename__ = 'webPages'
    __searchable__ = ['title', 'datas']  # these fields will be indexed by whoosh
    __analyzer__ = ChineseAnalyzer()  # configure analyzer; defaults to
    # StemmingAnalyzer if not specified

    id = db.Column(db.Integer, primary_key=True)
    url = db.Column(db.TEXT)
    title = db.Column(db.TEXT)  # Indexed fields are either String,
    refs = db.Column(db.TEXT)
    datas = db.Column(db.Text)  # Unicode, or Text
